<template class="operation-member-pop">
	<view class="pop-parent" @click="operationPopDismiss">
		<view class="pop" :style="dataSource.ance?'height: 450rpx':'height: 420rpx'">
			<image class="head-image" :src="dataSource.head" mode="aspectFill"></image>
			<text v-if="isBindingTree" class="pop-name">{{dataSource.surname+dataSource.name}}（{{dataSource.gxname}}）</text>
			<text v-else class="pop-name">{{dataSource.surname+dataSource.name}}</text>
			<text v-if="dataSource.ance" class="pop-address">祖籍地：{{dataSource.ance}}</text>
			<view class="pop-add-member-btn" @click="itemAddmemberClick">
				<text class="pop-add-member-txt">为{{dataSource.surname+dataSource.name}}添加亲人</text>
				<image class="pop-add-member-arrow" src="../../static/fan_dialog_to_add_family_arrow.gif"></image>
			</view>
			<view class="operation-view">
				<view v-if="dataSource.is_living==0||dataSource.PQD" class="operation-item" @click="itemInviteMemberClick">
					<image class="operation-item-img" src="../../static/operation-member-invite.png" mode="scaleToFill"></image>
					<text v-if="dataSource.is_living==0" class="operation-item-txt">上香祭拜</text>
					<text v-else class="operation-item-txt">发起会话</text>
				</view>
				<view v-else class="operation-item" @click="itemInviteMemberClick">
					<image class="operation-item-img" src="../../static/operation-member-invite.png" mode="scaleToFill"></image>
					<text class="operation-item-txt">邀请亲人</text>
				</view>
				<view class="operation-item" @click="itemMemberInfoClick" style="margin-left: 28rpx;margin-right: 28rpx;">
					<image class="operation-item-img" src="../../static/operation-member-info.png" mode="scaleToFill"></image>
					<text class="operation-item-txt">个人资料</text>
				</view>
				<view class="operation-item" @click="itemDelectMemberClick">
					<image class="operation-item-img"  src="../../static/dialog_tree_spectrum_tiaozheng.png" mode="scaleToFill"></image>
					<text class="operation-item-txt">删除此人</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var WxNotificationCenter = require('../tree-view/WxNotificationCenter.js');
	export default {
		name: "operation-member-pop",
		data() {
			return {
				
			}
		},
		props: { //此处定义传入的参数
			dataSource: {
				type: Object
			},
			isBindingTree: {
				type: Boolean
			},
		},
		methods: {
			///点击用户
			itemAddmemberClick(e) {
				let item = e.currentTarget.dataset.item;
				///回调事件
				WxNotificationCenter.postNotificationName('NOTI_ADDMEMBER', item);
			},
			itemInviteMemberClick(e) {
				this.$emit('invite');
			},
			itemMemberInfoClick(e) {
				let item = e.currentTarget.dataset.item;
				///回调事件
				WxNotificationCenter.postNotificationName('NOTI_MEMBERINFO', item);
			},
			itemDelectMemberClick(e) {
				let item = e.currentTarget.dataset.item;
				///回调事件
				WxNotificationCenter.postNotificationName('NOTI_DELECTMEMBER', item);
			},
			operationPopDismiss() {
				///回调事件
				WxNotificationCenter.postNotificationName('NOTI_OPERATIONDISMISS');
			},
		}
	}
</script>

<style>
	@import "operation-member-pop.css";
</style>
